﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Tasks;
using WCYCReader.UserControls;

namespace WCYCReader.Pages
{
    public partial class AboutPage : PhoneApplicationPage
    {       
        
        private HelpControl hc = new HelpControl();
        

        public AboutPage()
        {
            this.InitializeComponent();
        }

        private void Help_Click(object sender, RoutedEventArgs e)
        {
            this.hc.SetPhoneApplicationPage(this, "AboutPage");
            this.LayoutRoot.Children.Add(this.hc);
        }

        private void Hyperlink_Click(object sender, RoutedEventArgs e)
        {
            WebBrowserTask task = new WebBrowserTask();
            task.Uri = new Uri("http://www.xboxad.com", UriKind.Absolute);
            task.Show();
        }



        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            App.QQReader_prePageId = App.QQReader_pageId;
            App.QQReader_pageId = "QQReader_AboutPage";
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            if (this.LayoutRoot.Children.IndexOf(this.hc) >= 0)
            {
                this.LayoutRoot.Children.Remove(this.hc);
            }
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        public void RemoveHelp()
        {
            if (this.LayoutRoot.Children.IndexOf(this.hc) >= 0)
            {
                this.LayoutRoot.Children.Remove(this.hc);
            }
        }

        private void Update_Click(object sender, RoutedEventArgs e)
        {
        }
    }
}